rm(list=ls())

library(tidyverse)
library(estimatr)
library(magrittr)
library(gtable)
library(gt)
library(sandwich)
library(lmtest)
library(stargazer)
library(broom)
library(survey)
library(ggforce)      
library(broom.helpers)
library(foreign)

#----------------------------------------------------------------------------------------------
#PRELIMINARIES---------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

setwd("/Users/nicholaskuipers/Dropbox/selection_lab_experiment/kuipers_replication_file")

#LOAD HELPER FUNCTION
source("./code/_functions.R")

#LOAD OBJECT NAMES TO KEEP AFTER EACH SCRIPT
keep_objs = c("main_df", "supp_df", "write_latex", "keep_objs")

#LOAD AND CLEAN RAW DATA
source("./code/_clean_data.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  
  
#----------------------------------------------------------------------------------------------
#TABLES----------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

#TABLE 2
source("./code/table_2.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE 3
source("./code/table_3.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A1
source("./code/table_a1.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A2
source("./code/table_a2.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A4
source("./code/table_a4.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A5
source("./code/table_a5.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A6
source("./code/table_a6.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A7
source("./code/table_a7.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A8
source("./code/table_a8.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A9
source("./code/table_a9.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A10
source("./code/table_a10.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A11
source("./code/table_a11.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A12
source("./code/table_a12.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A13
source("./code/table_a13.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  

#TABLE A14
source("./code/table_a14.R")
rm(list=setdiff(ls(), keep_objs)) #clean up  


#----------------------------------------------------------------------------------------------
#FIGURES---------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

#FIGURE 3
source("./code/figure_3.R")
rm(list=setdiff(ls(), keep_objs)) #clean up 

#FIGURE 4
source("./code/figure_4.R")
rm(list=setdiff(ls(), keep_objs)) #clean up 

#FIGURE A1
source("./code/figure_a1.R")
rm(list=setdiff(ls(), keep_objs)) #clean up 

#FIGURE A2
source("./code/figure_a2.R")
rm(list=setdiff(ls(), keep_objs)) #clean up 

#FIGURE A3
source("./code/figure_a3.R")
rm(list=setdiff(ls(), keep_objs)) #clean up 



